﻿using PetaPoco;
using System;
using System.ComponentModel.DataAnnotations;

namespace Cxuu.Models
{
    [TableName("cxuu_notice")]
    [PrimaryKey("Id", AutoIncrement = true)]
    public class Notice
    {
        public int Id { get; set; }
        public string Title { get; set; }

        /// <summary>
        /// 通知类型  0 系统  1 用户
        /// </summary>
        public int Type { get; set; }
        public string Content { get; set; }
        public int PostUid { get; set; }
        public string Att { get; set; }
        public DateTime PostTime { get; set; }
    }

    public class EditNotice
    {
        [Display(Name = "标题")]
        [Required(ErrorMessage = "标题未填写")]
        public string Title { get; set; }

        [Display(Name = "通知内容")]
        [Required(ErrorMessage = "内容未填写")]
        public string Content { get; set; }
        [Display(Name = "附件")]
        public string Att { get; set; }
        [Display(Name = "收件人")]
        [Required(ErrorMessage = "收件人未选择")]
        public string GetUid { get; set; }
        public DateTime PostTime { get; set; }
    }

    public class ViewNotice
    {
        public int Id { get; set; }
        public string Title { get; set; }

        public int Type { get; set; }
        public string Content { get; set; }

        public int Status { get; set; }
        public int GetUid { get; set; }
        public int PostUid { get; set; }
        public string Att { get; set; }
        public DateTime PostTime { get; set; }
        public DateTime ReadTime { get; set; }

        public string Username { get; set; }
        public string Nickname { get; set; }
        public string Postname { get; set; }
        public string PostNickname { get; set; }
        public int NoticeId { get; set; }
    }


}
